<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>电力运维云</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Access-Control-Allow-Origin" content="*" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1"
    />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection" content="telephone=no" />
    <!-- <link rel="icon" href="images/favicon.ico"> -->
    <link rel="stylesheet" href="lib/layui-v2.5.5/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/layuimini.css?v=2.0.0" media="all" />
    <link
      rel="stylesheet"
      href="lib/font-awesome-4.7.0/css/font-awesome.min.css"
      media="all"
    />
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style id="layuimini-bg-color"></style>
  </head>

  <body class="layui-layout-body layuimini-all">
    <div class="layui-layout layui-layout-admin">
      <div class="layui-header header">
        <div class="layui-logo layuimini-logo" id="logoPic"></div>

        <div class="layuimini-header-content">
          <a>
            <div class="layuimini-tool">
              <i title="展开" class="fa fa-outdent" data-side-fold="1"></i>
            </div>
          </a>

          <!--电脑端头部菜单-->
          <ul
            class="layui-nav layui-layout-left layuimini-header-menu mobile layui-hide-xs layuimini-menu-header-pc"
          ></ul>

          <!--手机端头部菜单-->
          <ul
            class="layui-nav layui-layout-left layuimini-header-menu mobile layui-hide-sm"
          >
            <li class="layui-nav-item">
              <a href="javascript:;"><i class="fa fa-list-ul"></i> 选择模块</a>
              <dl class="layui-nav-child layuimini-menu-header-mobile"></dl>
            </li>
          </ul>

          <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item" lay-unselect>
              <a id="onceClick" href="javascript:;" data-refresh="刷新"
                ><i class="fa fa-refresh"></i
              ></a>
            </li>
            <li class="layui-nav-item" lay-unselect id="msg">
              <!-- <a href="javascript:;" data-clear="清理" class="layuimini-clear"><i class="fa fa-trash-o"></i></a> -->
              <a
                href="javascript:;"
                layuimini-content-href="page/retime_alarm.html"
                data-title="实时报警"
              >
                <i class="layui-icon layui-icon-notice"></i>
                <div id="msg_alarm"></div>
                <!-- 如果有新消息，则显示小圆点 -->
              </a>
            </li>
            <li class="layui-nav-item mobile layui-hide-xs" lay-unselect>
              <a href="javascript:;" data-check-screen="full"
                ><i class="fa fa-arrows-alt"></i
              ></a>
            </li>
            <li class="layui-nav-item layuimini-setting">
              <a id="login_name" href="javascript:;"></a>
              <dl class="layui-nav-child">
                <!-- <dd>
                            <a href="javascript:;" layuimini-content-href="page/user-setting.html" data-title="基本资料" data-icon="fa fa-gears">基本资料<span class="layui-badge-dot"></span></a>
                        </dd> -->
                <dd>
                  <a
                    href="javascript:;"
                    layuimini-content-href="page/user-password.html"
                    data-title="修改密码"
                    data-icon="fa fa-gears"
                    >修改密码</a
                  >
                </dd>
                <dd>
                  <hr />
                </dd>
                <dd>
                  <a href="javascript:;" class="login-out">退出登录</a>
                </dd>
              </dl>
            </li>
            <li
              class="layui-nav-item layuimini-select-bgcolor mobile layui-hide-xs"
              lay-unselect
            >
              <a href="javascript:;" data-bgcolor="配色方案"
                ><i class="fa fa-ellipsis-v"></i
              ></a>
            </li>
          </ul>
        </div>
      </div>

      <!--无限极左侧菜单-->
      <div class="layui-side layui-bg-black layuimini-menu-left"></div>

      <!--初始化加载层-->
      <!-- <div class="layuimini-loader">
        <div class="layuimini-loader-inner"></div>
    </div> -->

      <!--手机端遮罩层-->
      <div class="layuimini-make"></div>

      <!-- 移动导航 -->
      <div class="layuimini-site-mobile"><i class="layui-icon"></i></div>

      <div class="layui-body">
        <div
          class="layuimini-tab layui-tab-rollTool layui-tab"
          lay-filter="layuiminiTab"
          lay-allowclose="true"
        >
          <ul class="layui-tab-title">
            <li class="layui-this" id="layuiminiHomeTabId" lay-id=""></li>
          </ul>
          <div class="layui-tab-control">
            <li class="layuimini-tab-roll-left layui-icon layui-icon-left"></li>
            <li
              class="layuimini-tab-roll-right layui-icon layui-icon-right"
            ></li>
            <li class="layui-tab-tool layui-icon layui-icon-down">
              <ul class="layui-nav close-box">
                <li class="layui-nav-item">
                  <a href="javascript:;"
                    ><span class="layui-nav-more"></span
                  ></a>
                  <dl class="layui-nav-child">
                    <dd>
                      <a href="javascript:;" layuimini-tab-close="current"
                        >关 闭 当 前</a
                      >
                    </dd>
                    <dd>
                      <a href="javascript:;" layuimini-tab-close="other"
                        >关 闭 其 他</a
                      >
                    </dd>
                    <dd>
                      <a href="javascript:;" layuimini-tab-close="all"
                        >关 闭 全 部</a
                      >
                    </dd>
                  </dl>
                </li>
              </ul>
            </li>
          </div>
          <div class="layui-tab-content">
            <div
              id="layuiminiHomeTabIframe"
              class="layui-tab-item layui-show"
            ></div>
          </div>
        </div>
      </div>
    </div>
    <script src="lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
    <script src="js/lay-config.js?v=2.0.0" charset="utf-8"></script>
    <script src="lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script>
      layui.use(["jquery", "layer", "miniAdmin", "miniTongji"], function () {
        var $ = layui.jquery,
          layer = layui.layer,
          miniAdmin = layui.miniAdmin,
          miniTongji = layui.miniTongji;
        var loginName = sessionStorage.getItem("SaveLogName");
        $("#login_name").text(loginName);

        var options = {
          iniUrl: "api/menus.-ceshi.json", // 初始化接口
          clearUrl: "api/clear.json", // 缓存清理接口
          urlHashLocation: false, // 是否打开hash定位
          bgColorDefault: 0, // 主题默认配置
          multiModule: true, // 是否开启多模块
          menuChildOpen: false, // 是否默认展开菜单
          loadingTime: 0, // 初始化加载时间
          pageAnim: true, // iframe窗口动画
          maxTabNum: 20, // 最大的tab打开数量
        };
        miniAdmin.render(options);

        // 百度统计代码，只统计指定域名
        // miniTongji.render({
        //     specific: true,
        //     domains: [
        //         '99php.cn',
        //         'layuimini.99php.cn',
        //         'layuimini-onepage.99php.cn',
        //     ],
        // });

        $(".login-out").on("click", function () {
          layer.msg("退出登录成功", { icon: 1, time: 1000 }, function () {
            window.location = "./page/login-1.html";
          });
        });

        /***********首页报警提示条数***********/
        var ret_alarm = JSON.parse(sessionStorage.getItem("HpowerNumber"));

        function getAlarm() {
          $.ajax({
            url:
              "/oms-web/real-time/event-authority?token=" +
              token +
              "&lastEventTime=",
            type: "post",
            data: JSON.stringify(ret_alarm.stationAuthorityList),
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
              if (data.code == -1) {
                window.location = "page/login-1.html";
              }
              if (data.data == null || data.data == undefined) {
              } else {
                if (data.data.length != 0) {
                  var mag = "";
                  mag +=
                    '<span class="layui-badge-dot" style="margin-left: 11px;margin-top: -11px;"><span style="font-size: 12px;margin-top: -30px;margin-left: 6px;position: absolute;">' +
                    data.data.length +
                    "</span></span>";
                  $("#msg_alarm").html(mag);
                }
              }
            },
            error: function () {
              layer.msg("获取实时数据失败！");
            },
          });
        }
        getAlarm();
      });

      // 2020-3-25 HF 验证是否登录
      var token = sessionStorage.getItem("newtoken");
      if (!token) {
        window.location = "page/login-1.html";
      }

      var jj = 0;
      var ee = 0;
      var bb = 0;
      var yy = 0;

      // 巡检
      function show(x) {
        var html_tree = "";
        var html_code = x.split(",")[0];
        var html_id = "#" + x.split(",")[1];
        if ($(html_id).hasClass("layui-nav-itemed")) {
          $(html_id).removeClass("layui-nav-itemed");
          $(html_id).find("dl").remove();
          setTimeout(function () {
            $(html_id).removeClass("layui-this");
          }, 10);
        } else {
          $(html_id).addClass("layui-nav-itemed");
          $.ajax({
            url:
              "/oms-web/devices/getdevicetype?token=" +
              token +
              "&stationCode=" +
              html_code,
            type: "get",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
              if (data.code == -1) {
                window.location = "page/login-1.html";
              }
              if (data.data == null || data.data == undefined) {
              } else {
                html_tree += '<dl class="layui-nav-child">';
                for (let m = 0; m < data.data.length; m++) {
                  jj++;
                  var deviceType = data.data[m].deviceType;
                  var c = "xo" + jj;
                  html_tree +=
                    '<dd class="" id="' +
                    c +
                    '"><a onclick="device(\'' +
                    html_code +
                    "," +
                    deviceType +
                    "," +
                    c +
                    '\')" href="javascript:;" class="layui-menu-tips" ><i class="fa fa-folder-open-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                    data.data[m].text +
                    '</span><span class="layui-nav-more"></span></a></dd>';
                }
                html_tree += "</dl>";

                // if ($(html_id).hasClass("layui-nav-itemed")) {
                //     $(html_id).removeClass();
                // }
                setTimeout(function () {
                  $(html_id).addClass("layui-nav-itemed");
                }, 10);
                $(html_id).append(html_tree);
              }
            },
            error: function () {
              layer.msg("暂无数据!");
              $(html_id).removeClass("layui-nav-itemed");
              setTimeout(function () {
                $(html_id).removeClass("layui-this");
              }, 10);
            },
          });
        }
      }

      function device(x) {
        var html_tree = "";
        var html2_id = "#" + x.split(",")[2];
        if ($(html2_id).hasClass("layui-nav-itemed")) {
          $(html2_id).removeClass("layui-nav-itemed");
          $(html2_id).find("dl").remove();
          setTimeout(function () {
            $(html2_id).removeClass("layui-this");
          }, 10);
        } else {
          $(html2_id).addClass("layui-nav-itemed");
          $.ajax({
            url:
              "/oms-web/devices/getdevicesbytype?token=" +
              token +
              "&stationCode=" +
              x.split(",")[0] +
              "&deviceType=" +
              x.split(",")[1],
            type: "get",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
              if (data.code == -1) {
                window.location = "page/login-1.html";
              }
              if (data.data == null || data.data == undefined) {
              } else {
                html_tree += '<dl class="layui-nav-child">';
                for (let m = 0; m < data.data.length; m++) {
                  ee++;
                  var code = data.data[m].deviceCode;
                  var type = data.data[m].deviceType;
                  var text = data.data[m].typeText;
                  var eej = "mc" + ee;
                  if (type == 5 || type == 12 || type == 16) {
                    html_tree +=
                      '<dd id="' +
                      eej +
                      '"><a onclick="save_code(\'' +
                      code +
                      "," +
                      type +
                      "," +
                      text +
                      "," +
                      eej +
                      '\')" href="javascript:;" data-title="巡检" layuimini-content-href="page/check/overhaul.html"  class="layui-menu-tips" ><i class="fa fa-file-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                      data.data[m].text +
                      "</span></a></dd>";
                  } else {
                    html_tree +=
                      '<dd><a onclick="call_data1()" href="javascript:;"  class="layui-menu-tips" ><i class="fa fa-file-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                      data.data[m].text +
                      "</span></a></dd>";
                  }
                }
                html_tree += "</dl>";
                setTimeout(function () {
                  $(html2_id).addClass("layui-nav-itemed");
                }, 10);
                $(html2_id).append(html_tree);
              }
            },
            error: function () {
              layer.msg("暂无数据!");
            },
          });
        }
      }
      // 检修
      function show2(x) {
        var html_tree = "";
        var html_code = x.split(",")[0];
        var html_id = "#" + x.split(",")[1];
        if ($(html_id).hasClass("layui-nav-itemed")) {
          $(html_id).removeClass("layui-nav-itemed");
          $(html_id).find("dl").remove();
          setTimeout(function () {
            $(html_id).removeClass("layui-this");
          }, 10);
        } else {
          $(html_id).addClass("layui-nav-itemed");
          $.ajax({
            url:
              "/oms-web/devices/getdevicetype?token=" +
              token +
              "&stationCode=" +
              html_code,
            type: "get",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
              if (data.code == -1) {
                window.location = "page/login-1.html";
              }
              if (data.data == null || data.data == undefined) {
              } else {
                html_tree += '<dl class="layui-nav-child">';
                for (let m = 0; m < data.data.length; m++) {
                  bb++;
                  var deviceType = data.data[m].deviceType;
                  var c = "do" + bb;
                  html_tree +=
                    '<dd class="" id="' +
                    c +
                    '"><a onclick="device2(\'' +
                    html_code +
                    "," +
                    deviceType +
                    "," +
                    c +
                    '\')" href="javascript:;" class="layui-menu-tips" ><i class="fa fa-folder-open-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                    data.data[m].text +
                    '</span><span class="layui-nav-more"></span></a></dd>';
                }
                html_tree += "</dl>";

                // if ($(html_id).hasClass("layui-nav-itemed")) {
                //     $(html_id).removeClass();
                // }
                setTimeout(function () {
                  $(html_id).addClass("layui-nav-itemed");
                }, 10);
                $(html_id).append(html_tree);
              }
            },
            error: function () {
              layer.msg("暂无数据!");
              $(html_id).removeClass("layui-nav-itemed");
              setTimeout(function () {
                $(html_id).removeClass("layui-this");
              }, 10);
            },
          });
        }
      }

      function device2(x) {
        var html_tree = "";
        var html2_id = "#" + x.split(",")[2];
        if ($(html2_id).hasClass("layui-nav-itemed")) {
          $(html2_id).removeClass("layui-nav-itemed");
          $(html2_id).find("dl").remove();
          setTimeout(function () {
            $(html2_id).removeClass("layui-this");
          }, 10);
        } else {
          $(html2_id).addClass("layui-nav-itemed");
          $.ajax({
            url:
              "/oms-web/devices/getdevicesbytype?token=" +
              token +
              "&stationCode=" +
              x.split(",")[0] +
              "&deviceType=" +
              x.split(",")[1],
            type: "get",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
              if (data.code == -1) {
                window.location = "page/login-1.html";
              }
              if (data.data == null || data.data == undefined) {
              } else {
                html_tree += '<dl class="layui-nav-child">';
                for (let m = 0; m < data.data.length; m++) {
                  var code = data.data[m].deviceCode;
                  var type = data.data[m].deviceType;
                  var text = data.data[m].typeText;
                  if (type == 5 || type == 16) {
                    // if($(html2_id).find('dd').hasClass("layui-this")){
                    //         console.log(1);
                    // }else{
                    //     console.log(2);

                    // }
                    html_tree +=
                      "<dd><a onclick=\"save_code2('" +
                      code +
                      "," +
                      type +
                      "," +
                      text +
                      '\')" href="javascript:;" data-title="检修" layuimini-content-href="page/examine/examine_list.html"  class="layui-menu-tips" ><i class="fa fa-file-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                      data.data[m].text +
                      "</span></a></dd>";
                  } else {
                    html_tree +=
                      '<dd><a onclick="call_data()" href="javascript:;" class="layui-menu-tips" ><i class="fa fa-file-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                      data.data[m].text +
                      "</span></a></dd>";
                  }
                }
                html_tree += "</dl>";
                setTimeout(function () {
                  $(html2_id).addClass("layui-nav-itemed");
                }, 10);
                $(html2_id).append(html_tree);
              }
            },
            error: function () {
              layer.msg("暂无数据!");
            },
          });
        }
      }
      // 评分报告
      function show3(x) {
        var html_tree = "";
        var html_code = x.split(",")[0];
        var html_id = "#" + x.split(",")[1];
        if ($(html_id).hasClass("layui-nav-itemed")) {
          $(html_id).removeClass("layui-nav-itemed");
          $(html_id).find("dl").remove();
          setTimeout(function () {
            $(html_id).removeClass("layui-this");
          }, 10);
        } else {
          $(html_id).addClass("layui-nav-itemed");
          $.ajax({
            url:
              "/oms-web/devices/getdevicetype?token=" +
              token +
              "&stationCode=" +
              html_code,
            type: "get",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
              if (data.code == -1) {
                window.location = "page/login-1.html";
              }
              if (data.data == null || data.data == undefined) {
              } else {
                html_tree += '<dl class="layui-nav-child">';
                for (let m = 0; m < data.data.length; m++) {
                  yy++;
                  var deviceType = data.data[m].deviceType;
                  var c = "ao" + yy;
                  html_tree +=
                    '<dd class="" id="' +
                    c +
                    '"><a onclick="device3(\'' +
                    html_code +
                    "," +
                    deviceType +
                    "," +
                    c +
                    '\')" href="javascript:;" class="layui-menu-tips" ><i class="fa fa-folder-open-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                    data.data[m].text +
                    '</span><span class="layui-nav-more"></span></a></dd>';
                }
                html_tree += "</dl>";

                // if ($(html_id).hasClass("layui-nav-itemed")) {
                //     $(html_id).removeClass();
                // }
                setTimeout(function () {
                  $(html_id).addClass("layui-nav-itemed");
                }, 10);
                $(html_id).append(html_tree);
              }
            },
            error: function () {
              layer.msg("暂无数据!");
              $(html_id).removeClass("layui-nav-itemed");
              setTimeout(function () {
                $(html_id).removeClass("layui-this");
              }, 10);
            },
          });
        }
      }

      function device3(x) {
        var html_tree = "";
        var html2_id = "#" + x.split(",")[2];

        if ($(html2_id).hasClass("layui-nav-itemed")) {
          $(html2_id).removeClass("layui-nav-itemed");
          $(html2_id).find("dl").remove();
          setTimeout(function () {
            $(html2_id).removeClass("layui-this");
          }, 10);
        } else {
          $(html2_id).addClass("layui-nav-itemed");
          $.ajax({
            url:
              "/oms-web/devices/getdevicesbytype?token=" +
              token +
              "&stationCode=" +
              x.split(",")[0] +
              "&deviceType=" +
              x.split(",")[1],
            type: "get",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
              if (data.code == -1) {
                window.location = "page/login-1.html";
              }
              if (data.data == null || data.data == undefined) {
              } else {
                html_tree += '<dl class="layui-nav-child">';
                for (let m = 0; m < data.data.length; m++) {
                  var code = data.data[m].deviceCode;
                  var type = data.data[m].deviceType;
                  var text = data.data[m].text;
                  var typeText = data.data[m].typeText;
                  if (type == 5 || type == 12 || type == 16 || type == 53) {
                    html_tree +=
                      '<dd class=""><a onclick="save_code3(\'' +
                      code +
                      "," +
                      type +
                      "," +
                      text +
                      "," +
                      typeText +
                      '\')" href="javascript:;" data-title="评分报告" layuimini-content-href="page/report/check_report.html"  class="layui-menu-tips" ><i class="fa fa-file-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                      data.data[m].text +
                      "</span></a></dd>";
                  } else {
                    html_tree +=
                      '<dd><a onclick="call_data()" href="javascript:;" class="layui-menu-tips" ><i class="fa fa-file-o"></i><span style=" margin-left: 5px;" class="layui-left-nav">' +
                      data.data[m].text +
                      "</span></a></dd>";
                  }
                }
                html_tree += "</dl>";
                setTimeout(function () {
                  $(html2_id).addClass("layui-nav-itemed");
                }, 10);
                $(html2_id).append(html_tree);
              }
            },
            error: function () {
              layer.msg("暂无数据!");
            },
          });
        }
      }

      function save_code(x) {
        sessionStorage.setItem("HsaveOverHaul_code", x.split(",")[0]);
        sessionStorage.setItem("HsaveOverHaul_type", x.split(",")[1]);
        sessionStorage.setItem("HsaveOverHaul_text", x.split(",")[2]);
      }
      function save_code2(x) {
        sessionStorage.setItem("HsaveExamine_code", x.split(",")[0]);
        sessionStorage.setItem("HsaveExamine_type", x.split(",")[1]);
        sessionStorage.setItem("HsaveExamine_text", x.split(",")[2]);
      }

      function save_code3(x) {
        sessionStorage.setItem("HsaveReport_code", x.split(",")[0]);
        sessionStorage.setItem("HsaveReport_type", x.split(",")[1]);
        sessionStorage.setItem("HsaveReport_text", x.split(",")[2]);
        sessionStorage.setItem("HsaveReport_textType", x.split(",")[3]);
      }

      function call_data() {
        layer.msg("暂无数据!");
      }
      function call_data1() {
        layer.msg("暂无数据!");
      }
    </script>
  </body>
</html>
